package com.ficus.road.maintain.service.smartnew;

import com.ficus.road.maintain.core.model.smartnew.SmartRoadGps;
import com.ficus.road.maintain.dao.smartnew.SmartRoadGpsDao;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author xiawen yang
 * @date 2022/3/3 下午7:51
 */
@Service
@RequiredArgsConstructor
public class SmartRoadGpsService {
    private final SmartRoadGpsDao smartRoadGpsDao;

    public SmartRoadGps saveOrUpdate(SmartRoadGps smartRoadGps) {
        return smartRoadGpsDao.saveOrUpdate(smartRoadGps);
    }

//    public List<SmartRoadGps> geoSearch(GpsLocation gpsLocation) {
//        Point point = new Point(gpsLocation.getLongitude(), gpsLocation.getLatitude());
//        List<AggregationOperation> aggregationList = new ArrayList<>();
//        aggregationList.add(new GeoNearDocument(new Query(), point, "distance", mergeDistance));
//        Aggregation agg = Aggregation.newAggregation(aggregationList);
//        List<SmartRoadGps> result = smartRoadGpsDao.aggregate(agg);
//        return result;
//    }
}
